var ip = 'http://' + document.location.host;

//弹窗返回按钮
$('.closeBtn').on('click',function() {
	location.reload();
	window.parent.document.getElementById("alert_shade").style.display="none";
	window.parent.document.getElementById("edit_box").style.display="none";
});

	//暂存
	$('.saveBtn').on('click', function() {
		var title = $('#title').val();
		var description = $('#description').val();
		var id = $('#id').val();
		$.ajax({
			type: 'POST',
	        url: ip+'/subscribe/update',
	        data:{"functionName":title,"description":description,"id":id},
	        success: function(res) {
	        	if(res.code == 200){
	        		location.reload();
	        		parent.location.reload();
	        	}else{
	        		layer.alert(res.msg, {icon: 5,title: "提示"});
	        	}
	            
	        }
		})
	});
	